﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VMExplorer
{
  static class Extensions
  {
    public static uint AlignUp(this uint value, uint step)
    {
      if (step == 0) throw new ArgumentOutOfRangeException("step must be at least 1");
      return step * ((value + step - 1) / step);
    }

    public static IntPtr Offset(this IntPtr value, uint offset)
    {
      return (IntPtr)(value.ToInt32() + offset);
    }
  }
}
